<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>

<script type="text/javascript" src="lib/vue-2.6.10.js"></script>
<script type="text/javascript" src="lib/vue-resource.js"></script>

<body>
	
	<div id="app">
		<h1>{{ title }}</h1>
		<button @click="jsonps()">点击发送ajax -- jsonp方法</button>
	</div>
	<script type="text/javascript">
		new Vue({
			el:"#app",
			data:{
				title:'交互',
				url:'http://vue1906.strive1.top/banner/getimg2.php',
			},
			methods:{
				jsonps(){
					this.$http.jsonp(this.url,{a:10},{jsonp:'cb'}).then(res=>{
						console.log(res.data)
					},err=>{
						console.log('你是不是傻')
					});
				}
			}
		})

	

	</script>

</body>
</html>